﻿CREATE TABLE [dbo].[MedExam]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
    [BkMemberId] BIGINT NULL, 
    [WxUserId] BIGINT NULL, 
    [CardType] NVARCHAR(50) NULL, 
    [CardNo] NVARCHAR(50) NULL, 
    [ExamNo] NVARCHAR(50) NULL, 
    [ExamName] NVARCHAR(50) NULL, 
    [ExamDate] NVARCHAR(50) NULL, 
    [PatientId] NVARCHAR(50) NULL, 
    [PatientName] NVARCHAR(50) NULL, 
    [PatientSex] NVARCHAR(50) NULL, 
    [ExamStatus] NVARCHAR(50) NULL 
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'检验单',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = NULL,
    @level2name = NULL
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'主键，自增长',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'Id'
GO

EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'BkMember.Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'BkMemberId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'WxUser.Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'WxUserId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'卡类型: 0-诊疗卡1-健康卡 2-市民卡 3-未知',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'CardType'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者信息卡卡号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'CardNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'检查申请单编号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = 'ExamNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'检查名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = 'ExamName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'开单日期',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = 'ExamDate'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者唯一标识',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'PatientId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'PatientName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者性别',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = N'PatientSex'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'单据状态 0 未出  1 已出',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'MedExam',
    @level2type = N'COLUMN',
    @level2name = 'ExamStatus'